<?php
require_once('Zend/View/Helper/Abstract.php');

class Kbs_View_Helper_Syntaxhighlight2 extends Zend_View_Helper_Abstract
{
    public function syntaxhighlight2($debug = false)
    {
        $highlightPath = $this->view->serverUrl() . '/library/syntaxhighlighter_2.0.320/';

        $this->view->headLink()->appendStylesheet($this->view->pathCss . 'shThemeForPhp.css');

        /*$html .= '<script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushBash.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushCpp.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushCSharp.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushDelphi.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushDiff.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushGroovy.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushJava.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushPlain.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushPython.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushRuby.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushScala.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushSql.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushVb.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushXml.js"></script>
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushCss.js"></script>'
            <script type="text/javascript" src="library/syntaxhighlighter20296/scripts/shBrushJScript.js"></script>';*/

        $this->view->inlineScript()->appendFile($highlightPath . 'scripts/shCore.js')
                                   ->appendFile($highlightPath . 'scripts/shBrushPhp.js')
                                   ->appendFile($highlightPath . 'scripts/shBrushXml.js')
                                   ->appendScript('SyntaxHighlighter.config.clipboardSwf = "' 
                                                 . $highlightPath . 'scripts/clipboard.swf";' . PHP_EOL
                            . 'SyntaxHighlighter.config.debug = ' . ($debug ? 'true' : 'false') . ';' . PHP_EOL
                                                 . 'SyntaxHighlighter.all();' . PHP_EOL
                                                 );
    }
}